import uuid
from typing import List


def generate_unique_str(forbidden) -> str:
    """Generate a string that is not forbidden.

    Args:
        forbidden: the list of forbidden strings

    Returns:
        a string not in ``forbidden``
    """
    while True:
        res = "uuid_{}".format(uuid.uuid4().hex)
        if res in forbidden:
            pass
        else:
            return res


def generate_unique_str_n(forbidden, n: int) -> List[str]:
    """Generate ``n`` distinct strings that are not forbidden

    Args:
        forbidden:  the list of forbidden strings
        n: the number of desired strings

    Returns:
        a list of ``n`` distinct strings
    """
    ret = []

    forbidden_s = set(forbidden)
    for _ in range(n):
        x = generate_unique_str(forbidden_s)
        ret.append(x)
        forbidden_s.add(x)
    return ret

